/*
 * @Description: 长势苗情分析
 */
import zhreq from "@/api/axios";
export default {
  queryGrowthPhaseNoByBatchNo(batchNo) {
    return zhreq.get(`/v3/growth/growthSeedAnalysis/queryGrowthPhaseNoByBatchNo?batchNo=${batchNo}`);
  },

  /**
   * @description: 获取长势图信息 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getgrowtop(no) {
    return zhreq.post(`/v3/templateTenant/growthPhase/queryByPlantVarietyNo`, {
      plantVarietyNo: no,
      organizationNo: sessionStorage.organizationNo
    });
  },
  getgrowtopimg(picNo) {
    return zhreq.get(`/v3/category/phasePicture/queryByNo?no=${picNo}`);
  },

  getgrowtopimgs(picNo) {
    return zhreq.get(`/v3/templateTenant/phasePicture/queryByNo?no=${picNo}&organizationNo=${sessionStorage.organizationNo}`);
  },
  /**
   * @description: 获取 *代表必填
   */
  getnowgrowid(batchNo) {
    return zhreq.get(`/growth/queryGrowthPhaseIdByBatchId/${batchNo}`);
  },
  // 查询生长阶段
  queryByPlantVarietyNo(no) {
    return zhreq.post('/v3/templateTenant/growthPhase/queryByPlantVarietyNo', {
      plantVarietyNo: no,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
  * @description: 获取数据图片*代表必填
  */
  getdatapictureid(params) {
    return zhreq.post(`/v3/growth/growthSeedAnalysis/queryCollectRecordPageByBatchNoAndCameraId`, {
      "entity": params.entity,
      // "entity": 7,
      // "page": 1,
      // "size": 10
      "page": params.page,
      "size": params.size,
      "sortStr": "collectTime"

    });
  },
  newgetdatapictureid(params) {
    return zhreq.post(`/v3/growth/growthSeedAnalysis/queryPicturePositionByBatchNoAndPhaseNoAndCameraId`, {
      ...params
    });
  },
  /**
  * @description: 通过采集数据id获取环境数据*代表必填
  */
  getdataitembycollid(collectRecordNo) {
    return zhreq.get(`/v3/growth/growthSeedAnalysis/queryCollectDataItemListByRecordNo?collectRecordNo=${collectRecordNo}`);
  },
  /**
  * @description: 通过图片id获取图片详情*代表必填
  */
  getpicmesbypicid(no) {
    return zhreq.get(`/v3/growth/collectPicture/queryByNo?no=${no}`);
  },
  /**
  * @description: 获取dataitem集合*代表必填
  */
  getdataitemlist(batchNo, cameraId) {
    return zhreq.get(`/v3/growth/growthSeedAnalysis/queryDataItemListByBatchNoAndCameraId?batchNo=${batchNo}&cameraId=${cameraId}`);
  },
  /**
  * @description: dataitemid获取数据*代表必填
  */
  getdatabydataitemid(params) {
    return zhreq.get(`/v3/growth/growthSeedAnalysis/querySingleDataItemByBatchNoAndDataItemIdAndCameraId?batchNo=${params.batchNo}&dataItemId=${params.dataItemId}&cameraId=${params.cameraId}&beginTime=${params.beginTime}&endTime=${params.endTime}`);
  },
  GrowthCameraBatch(e) {
    return zhreq.get(`/v3/iot/camera/queryGrowthCameraByBatchNoNew?no=${e}`);
  }
};
